package org.example.movies.dao.impl;


import org.example.movies.dao.CateLogDao;
import org.example.movies.pojo.TCatelog;
import org.example.movies.pojo.TFilm;
import org.example.movies.utils.JDBCUtils;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.jdbc.core.JdbcTemplate;

import java.util.List;


public class CateLogDaoImpl implements CateLogDao {

    private JdbcTemplate template = new JdbcTemplate(JDBCUtils.getDataSource());

    @Override
    public List<TCatelog> selelctCateList() {

        String sql = "SELECT id, is_use, name, sort, is_vip  FROM t_catelog";
        List<TCatelog> list = template.query(sql, new BeanPropertyRowMapper<TCatelog>(TCatelog.class));

        return list;
    }
}
